<template>
    <div>
        <span>我是BaseA组件</span>
        <h3>{{ messageA }}</h3>
    </div>
</template>
<script>
import Bus from "../utils/EventBus"
export default {
    name: "BaseA",
    data() {
        return {
            messageA: "你好",
        };
    },
    created() {
        Bus.on("changeMsg", (data) => {
            this.messageA = data;
        });
    },
    beforeUnmount() {
        Bus.off("changeMsg");
    }
};
</script>
<style scoped>
div {
    border: 1px solid #da1010;
    color: rgb(14, 119, 217);
}
</style>